/*
 * SASettingslistContainer.h
 *
 *  Created on: 2010-06-04
 *      Author: NONO
 */

#ifndef __SASETTINGSLISTCONTAINER_H__
#define __SASETTINGSLISTCONTAINER_H__


// INCLUDES
#include <coecntrl.h>
 
// FORWARD DECLARATIONS
// System includes
#include <aknlists.h>                   // CAknColumnListBox


// CLASS DECLARATION
// User includes
#include "SABaseContainer.h"

class CSASettingItemList;
class CSASettings;

// modifiedy by Sandy 2008-1-14         >>>>>>>>>>>>>>
class CMbsPhoneSelectControl;
//                                      >>>>>>>>>>>>>>


/**
*  CSASettingslistContainer  container control class.
*  
*/
class CSASettingslistContainer : public CSABaseContainer

    {
    public:
    
        enum TComponentIndication   // Current component indication
        {
            ENone,
            ESettingList,
        };

    public: // Constructors and destructor
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);
        
        CSASettingslistContainer(CSAAppUi& aAppUi,CSASettings& aSettings);


        /**
        * Destructor.
        */
        ~CSASettingslistContainer();
        
    public:     // Functions from base classes
        
        void ChangeViewMenuL(TInt aResourceId);


    public: // members
        void ChangeSelectedItemL();
        void EditItemL(TInt aIndex);
        void HandleCommandFromContainerL(TInt aCommand);

        /**
        * Interface of view.
        */
        void DynInitMenuPaneFromContainerL(TInt aResourceId, CEikMenuPane* aMenuPane);
        
    public:     // Data
        CArrayPtrFlat<HBufC>*       iTransNos;


    private: // constructor

    private: // from CoeControl

        TInt CountComponentControls() const;
        CCoeControl* ComponentControl(TInt aIndex) const;
        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
        
        /**
        * From CoeControl, HandleResourceChange.
        * Called by framework when the view layout is changed.
        */
        virtual void HandleResourceChange(TInt aType);

        
    private:
        void CreatePhoneSelectControlL();
        void CreateProtectionPhoneSelectControlL();
        void ChangeComponentL(TComponentIndication aCurrentComponent, TBool aDeleteOld = EFalse);
        void CreateSettingListL();
        void CreateProtectionSettingListL();
        void UpdatePhoneNumberSettingItem();
        void UpdateProtectionPhoneNumberSettingItem();

    private: //data

        CSASettingItemList* iSettingItemList;   
        // Components' data
        TComponentIndication    iCurrentComponent;

        CSASettings& iSettings;

    };

#endif /* __SASETTINGSLISTCONTAINER_H__ */
